/**************************************************************************
                              Property of INGENICO
 *************************************************************************/
/*+
 *  PROJECT        :    
 *  MODULE         :    pinpad
 *  FILEMANE       :    pinpad.h
 *  PURPOSE        :    pinpad interface for ssa
 *
 *  HISTORY
 *
 *  date         author     modifications
-*/
#ifndef __GENPINPAD_H
#define __GENPINPAD_H


/*+++******* EXPORTED #DEFINE CONSTANTS ******************************---*/
/*******************************************************************************
Displaying a prompt:
A prompt screen is built as a NULL terminated array of prompt indexes and flags.
The first part of the flag represents the line offset from the last line
starting at zero
example:

Prompt Index 1 = "HELLO"
Prompt Index 2 = "WORLD"


To display on the LCD:
+----------------+
|HELLO           |
|WORLD           |
|                |
|                |
+----------------+
Define the list

const Prompt_t HelloWorld[]= 
{ 
  {1,0},                 //prompt index 1 with no attributes set
  {2,0},                 //propmt index 2 with no attributes set
  {0,0}                  //null terminate
};

To display on the LCD:
+----------------+
|                |
|     HELLO      |
|     WORLD      |
|                |
+----------------+
 
Define the list

const Prompt_t HelloWorld[]= 
{ 
  {1,1|PT_ALIGN_CENTER},       //prompt index 1 with line offset and centering
  {2,PT_ALIGN_CENTER},         //propmt index 2 with centering
  {0,0}                        //null terminate
};

*******************************************************************************/

#define DEV_DISPLAY				0
#define DEV_KEYBOARD			1
#define DEV_PRINTER				2

//typedef  promptIndex_t;
typedef uint32 promptAttrib_t;
typedef /*@null@*/struct prompt_t* pnPrompt_t;
typedef /*@null@*/struct prompt_t const* pncPrompt_t;

/*typedef struct prompt_t
{
  promptIndex_t  index;
  promptAttrib_t attrib;
} prompt_t;
*/
#define PP_WAIT(x)  ttestall(0,x)

typedef enum
{
  PP_PASS_PASSWORD = 1,
  PP_PASS_FUNCTION,
  PP_PASS_OLD_PASSWORD,
  PP_PASS_NEW_PASSWORD,
  PP_PASS_VERIFY_PASSWORD,
  PP_PASS_REFUND_PASSWORD,
  PP_PASS_CHECKOUT_PASSWORD,
  PP_PASS_SECURITY_CODE,
  PP_PASS_ACCESS_CODE,
  PP_PASS_VOID_PASSWORD,
  PP_PASS_ADJUST_PASSWORD,
  PP_PASS_MANUAL_PASSWORD,
  PP_PASS_MERCHANT_PASSWORD,
  PP_PASS_SYSTEM_PASSWORD
} passwordPrompt_t;

#define SPP_LINE_NUMBER_MASK     ((1<<6)-1)

/*published defines*/
#define PT_ITALIC_OFF (0)
#define PT_BOLD_OFF (0)
#define PT_INVERSE_OFF (0)

#define PT_ITALIC_ON             ( 1 << 6 )
#define PT_OBLIQUE_ON            ( 1 << 7 )
#define PT_BOLD_ON               ( 1 << 8 )
#define PT_STRIKETHROUGH_ON      ( 1 << 9 )
#define PT_UNDERLINE_ON          ( 1 << 10 )
#define PT_DOUBLE_WIDTH_ON       ( 1 << 11 )
#define PT_INVERSE_ON            ( 1 << 12 )

#define SPP_ALIGN_MASK           ( 3 << 13 )
#define PT_ALIGN_LEFT            ( 1 << 13 )
#define PT_ALIGN_CENTER          ( 2 << 13 )
#define PT_ALIGN_RIGHT           ( 3 << 13 )
#define PT_CLEAR                 ( 1 << 15 )
#define PT_POINTER               ( 1 << 16)

#define PT_DOUBLE_HEIGHT_ON       ( 1 << 17 )

#define PT_HALF_HEIGHT_ON       ( 1 << 18 )
#define PT_HALF_WIDTH_ON        ( 1 << 19 )

#define PT_HALF_WIDTH_ON        ( 1 << 19 )
#define PT_CHECK_ON             ( 1 << 20 )

/** Set default attributes for the display for current command*/
#define PT_SET_DEFAULT          ( 1 << 21 )
/** use the previously defined defaults */
#define PT_USE_DEFAULT          ( 1 << 22 )

#define PT_NULL_TERMINATE        0x80000000
#define PT_SPACE_FILL            0x40000000

#define PP_FONT_ASCII_DEFAULT            (0)
#define PP_FONT_ASCII_FIXED_8x16         (1)
#define PP_FONT_ASCII_BOLD_FIXED_8x16    (2)
#define PP_FONT_ASCII_VAR_8x10           (3)
#define PP_FONT_ASCII_VAR_8x16           (4)
#define PP_FONT_ASCII_FIXED_6x8          (5)

#define PP_FONT_ASCII_FIXED_5x6           (6)
#define PP_FONT_ASCII_FIXED_6x12          (7)
#define PP_FONT_ASCII_FIXED_6x13          (8)
#define PP_FONT_ASCII_BOLD_FIXED_6x13     (9)


#define PP_PRINT_NORMAL		1
#define PP_PRINT_CONDESED		2
#define PP_PRINT_LARGE			3

// Keyboard Associated Definitions
#define DISPLAY_WIDTH     20

// Virtual Keyboard
#define VK_F1              0x01
#define VK_F2              0x02
#define VK_F3              0x03
#define VK_F4              0x04
#define VK_F5              0x05
#define VK_CHQ             0x06
#define VK_SAV             0x07
#define VK_CR              0x08
#define VK_FEED            0x09
#define VK_SYSTEM          0x0A
#define VK_UP              0x0B
#define VK_DOWN            0x0C
#define VK_FUNCTION        0x0D
#define VK_CLEAR           0x0E
#define VK_ENTER           ((uint8)0x0F)
#define VK_CANCEL          0x10
#define VK_00              0x11
#define VK_F6              0x16
#define VK_F7              0x17
#define VK_F8              0x18
#define VK_F9              0x19
#define VK_F10             0x1A
#define VK_F11             0x1B
#define VK_F12             0x1C
#define VK_0               0x30
#define VK_1               0x31
#define VK_2               0x32
#define VK_3               0x33
#define VK_4               0x34
#define VK_5               0x35
#define VK_6               0x36
#define VK_7               0x37
#define VK_8               0x38
#define VK_9               0x39

// Acceptable Keys Map (Bitwise)
#define ACCEPT_VK_F1              0x00010000
#define ACCEPT_VK_F2              0x00020000
#define ACCEPT_VK_F3              0x00040000
#define ACCEPT_VK_F4              0x00080000
#define ACCEPT_VK_F5              0x00100000
#define ACCEPT_VK_FEED            0x00000400
#define ACCEPT_VK_SYSTEM          0x00000800
#define ACCEPT_VK_FUNCTION        0x00001000
#define ACCEPT_VK_CLEAR           0x00002000
#define ACCEPT_VK_ENTER           0x00004000
#define ACCEPT_VK_CANCEL          0x00008000
#define ACCEPT_VK_F6              0x00200000
#define ACCEPT_VK_F7              0x00400000
#define ACCEPT_VK_F8              0x00800000
#define ACCEPT_VK_F9              0x01000000
#define ACCEPT_VK_F10             0x02000000
#define ACCEPT_VK_F11             0x04000000
#define ACCEPT_VK_F12             0x08000000
#define ACCEPT_VK_0               0x00000001
#define ACCEPT_VK_1               0x00000002
#define ACCEPT_VK_2               0x00000004
#define ACCEPT_VK_3               0x00000008
#define ACCEPT_VK_4               0x00000010
#define ACCEPT_VK_5               0x00000020
#define ACCEPT_VK_6               0x00000040
#define ACCEPT_VK_7               0x00000080
#define ACCEPT_VK_8               0x00000100
#define ACCEPT_VK_9               0x00000200
#define ACCEPT_NUMERIC            0x000003FF
#define ACCEPT_CONFIRM            ACCEPT_VK_CLEAR|ACCEPT_VK_CANCEL|ACCEPT_VK_ENTER
#define ACCEPT_SOFTKEYS           ACCEPT_VK_F1|ACCEPT_VK_F2|ACCEPT_VK_F3
#define ACCEPT_YES_NO             ACCEPT_VK_CLEAR|ACCEPT_VK_CANCEL|ACCEPT_VK_ENTER
#define ACCEPT_ALL                0xFFFFFFFF

// ACCOUNT TYPES
#define PP_ACCOUNT_SAVINGS    0
#define PP_ACCOUNT_CHEQUE     1
#define PP_ACCOUNT_CREDIT     2

// Keyboard Entry Options
#define SPP_LINE_BITS   (6)
#define SPP_LINE_SHIFT  (32-SPP_LINE_BITS)
#define KBD_LINE_1      (0<<SPP_LINE_SHIFT)
#define KBD_LINE_2      (1<<SPP_LINE_SHIFT)
#define KBD_LINE_3      (2<<SPP_LINE_SHIFT)
#define KBD_LINE_4      (3<<SPP_LINE_SHIFT)
#define KBD_LINE_5		  (4<<SPP_LINE_SHIFT)
#define KBD_LINE_6		  (5<<SPP_LINE_SHIFT)
#define KBD_LINE_7		  (6<<SPP_LINE_SHIFT)
#define KBD_LINE_8		  (7<<SPP_LINE_SHIFT)

#define SPP_COL_BITS   (6)
#define SPP_COL_SHIFT  (SPP_LINE_SHIFT-SPP_COL_BITS)

#define KBD_COL_1		   (0<<SPP_COL_SHIFT)
#define KBD_COL_2		   (1<<SPP_COL_SHIFT)
#define KBD_COL_3		   (2<<SPP_COL_SHIFT)
#define KBD_COL_4		   (3<<SPP_COL_SHIFT)
#define KBD_COL_5		   (4<<SPP_COL_SHIFT)
#define KBD_COL_6		   (5<<SPP_COL_SHIFT)
#define KBD_COL_7		   (6<<SPP_COL_SHIFT)
#define KBD_COL_8		   (7<<SPP_COL_SHIFT)
#define KBD_COL_9		   (8<<SPP_COL_SHIFT)
#define KBD_COL_10		 (9<<SPP_COL_SHIFT)
#define KBD_COL_11		 (10<<SPP_COL_SHIFT)
#define KBD_COL_12		 (11<<SPP_COL_SHIFT)
#define KBD_COL_13		 (12<<SPP_COL_SHIFT)
#define KBD_COL_14		 (13<<SPP_COL_SHIFT)
#define KBD_COL_15		 (14<<SPP_COL_SHIFT)
#define KBD_COL_16		 (15<<SPP_COL_SHIFT)
#define KBD_COL_17		 (16<<SPP_COL_SHIFT)
#define KBD_COL_18		 (17<<SPP_COL_SHIFT)
#define KBD_COL_19		 (18<<SPP_COL_SHIFT)
#define KBD_COL_20		 (19<<SPP_COL_SHIFT)

#define KBD_NO_OPTIONS          0x00000000
#define KBD_DISPLAY_ORIGINAL    0x00000001
#define KBD_DISABLE_EDITING     0x00000002
#define KBD_NO_TIMEOUT          0x00000004
#define KBD_DISABLE_ALPHA       0x00000008
#define KBD_OCTAL_DIGITS_ONLY   0x00000010
#define KBD_EXIT_ON_MAX         0x00000020
#define KBD_EXIT_ON_CLEAR_ENTER 0x00000040
#define KBD_SHOW_LAST_KEY       0x00000080
#define KBD_DISPLAY_ONLY        0x00000003
#define KBD_DISPLAY_ALPHA       0x00000041
#define KBD_DISPLAY_NUMERIC     0x00000049
#define KBD_NUMERIC_ONLY        0x00000008

#define KBD_FUNCTION_KEY_EXITS  0x00000100 /*for pin entry only*/
#define KBD_MASK_INPUT          0x00000200 
#define KBD_00_KEY_EXITS        0x00000400 

#define KBD_CURR_DECIMAL                 0x00010000
#define KBD_AMOUNT_DISPLAY_ORIGINAL      0x00001000
#define KBD_AMOUNT_ALIGN_LEFT            0x00002000
#define KBD_AMOUNT_ALLOW_ZERO            0x00004000
#define KBD_AMOUNT_IMPLY_CENTS           0x00008000
#define KBD_AMOUNT_EDIT_ORIGINAL         0x00020000
#define KBD_MIN_ALLOW_ZERO               0x00080000

#define KBD_BEHAVE_CLEAR_RESTART         0x00000000
#define KBD_BEHAVE_CLEAR_BACK            0x00000100
#define KBD_BEHAVE_00_ENABLED            0x00000200

#define KBD_F1                0xF8
#define KBD_F2                0xF9
#define KBD_F3                0xFA
#define KBD_TIMEOUT           0xFB
#define KBD_ENTER             0xFC
#define KBD_CANCEL            ((uint8)0xFD)
#define KBD_CLEAR             0xFE
#define KBD_NO_ENTRY          0xFF


#define KBD_DISPLAY_FORMAT	  	0x00000008

#define KBD_SEQ_TIME			      0x00000010
#define KBD_SEQ_DATE_TIME		    0x00000020
#define KBD_SEQ_TIME_DATE		    0x00000030

#define KBD_DATE_DAY_NONE 	    0x00000040
#define KBD_DATE_BUILD_RIGHT    0x00000080

#define KBD_DATE_SEP_BACKSLASH  0x00000000
#define KBD_DATE_SEP_FORSLASH   0x00000100
#define KBD_DATE_SEP_DASH   	  0x00000200
#define KBD_DATE_SEP_COLON		  0x00000300
#define KBD_DATE_SEP_SPACE		  0x00000400
#define KBD_DATE_SEP_H          0x00000500
#define KBD_DATE_SEP_2SPACE		  0x00000600
#define KBD_DATE_SEQ_DD_MM_YY	  0x00000000
#define KBD_DATE_SEQ_YY_MM_DD	  0x00000800
#define KBD_DATE_SEQ_MM_DD_YY   0x00001000
#define KBD_DATE_YEAR_YY		    0x00000000
#define KBD_DATE_YEAR_NONE		  0x00002000
#define KBD_DATE_YEAR_CCYY		  0x00004000
#define KBD_TIME_SEP_BACKSLASH  0x00000000
#define KBD_TIME_SEP_FORSLASH	  0x00010000
#define KBD_TIME_SEP_DASH	      0x00020000
#define KBD_TIME_SEP_COLON      0x00030000
#define KBD_TIME_SEP_SPACE      0x00040000
#define KBD_TIME_SEP_H          0x00050000
#define KBD_TIME_SEP_2SPACE		  0x00060000
#define KBD_TIME_SECS_SS	    	0x00000000
#define KBD_TIME_SECS_NONE	  	0x00080000

#define KBD_SEQ_DATE			      0x00000000

#define KBD_IPADDR_DOT_KEY_ENTER 0x00000010
#define KBD_IPADDR_DOT_KEY_FEED  0x00000020
#define KBD_IPADDR_DOT_KEY_FUNC  0x00000040
#define KBD_IPADDR_SUBNET_MASK   0x00000008

typedef uint32 kbdCursor_t;
#define KBD_SEL_CURSOR_ITALIC        (0x00000001)
#define KBD_SEL_CURSOR_BOLD          (0x00000002)
#define KBD_SEL_CURSOR_UNDERLINE     (0x00000004)
#define KBD_SEL_CURSOR_INVERSE       (0x00000008)
#define KBD_SEL_CURSOR_STRIKETHROUGH (0x00000010)
#define KBD_SEL_CURSOR_DOUBLE_HEIGHT (0x00000020)
#define KBD_SEL_CURSOR_DOUBLE_WIDTH  (0x00000040)
#define KBD_SEL_CURSOR_CHECK         (0x00000080)

#define SPP_SEL_HILITE_SHIFT         (8)
#define SPP_SEL_HILITE_MASK          (0xFF)

#define KBD_SEL_HILITE_ITALIC        (KBD_SEL_CURSOR_ITALIC<<SPP_SEL_HILITE_SHIFT)
#define KBD_SEL_HILITE_BOLD          (KBD_SEL_CURSOR_BOLD<<SPP_SEL_HILITE_SHIFT)
#define KBD_SEL_HILITE_UNDERLINE     (KBD_SEL_CURSOR_UNDERLINE<<SPP_SEL_HILITE_SHIFT)
#define KBD_SEL_HILITE_INVERSE       (KBD_SEL_CURSOR_INVERSE<<SPP_SEL_HILITE_SHIFT)
#define KBD_SEL_HILITE_STRIKETHROUGH (KBD_SEL_CURSOR_STRIKETHROUGH<<SPP_SEL_HILITE_SHIFT)
#define KBD_SEL_HILITE_DOUBLE_HEIGHT (KBD_SEL_CURSOR_DOUBLE_HEIGHT<<SPP_SEL_HILITE_SHIFT)
#define KBD_SEL_HILITE_DOUBLE_WIDTH  (KBD_SEL_CURSOR_DOUBLE_WIDTH<<SPP_SEL_HILITE_SHIFT)
#define KBD_SEL_HILITE_CHECK         (KBD_SEL_CURSOR_CHECK<<SPP_SEL_HILITE_SHIFT)

#define KBD_SEL_REVERSE_DIRECTION    0x00000200
#define KBD_SEL_CIRCULAR             0x00000400
#define KBD_SEL_HIGHLIGHTER_SCROLL   0x00000800


#define SPP_LINE_MASK               ((1<<SPP_LINE_BITS)-1)
#define SPP_SEL_TO_SHIFT            (SPP_LINE_SHIFT-SPP_LINE_BITS)
#define SPP_SEL_FROM_SHIFT          (SPP_SEL_TO_SHIFT-SPP_LINE_BITS)

#define KBD_SEL_FROM_LINE_1         (0)
#define KBD_SEL_FROM_LINE_2         (1<< SPP_SEL_FROM_SHIFT)
#define KBD_SEL_FROM_LINE_3         (2<< SPP_SEL_FROM_SHIFT)
#define KBD_SEL_FROM_LINE_4         (3<< SPP_SEL_FROM_SHIFT)
#define KBD_SEL_FROM_LINE_5         (4<< SPP_SEL_FROM_SHIFT)
#define KBD_SEL_FROM_LINE_6         (5<< SPP_SEL_FROM_SHIFT)
#define KBD_SEL_FROM_LINE_7         (6<< SPP_SEL_FROM_SHIFT)
#define KBD_SEL_FROM_LINE_8         (7<< SPP_SEL_FROM_SHIFT)
#define KBD_SEL_TO_LINE_1           (0)
#define KBD_SEL_TO_LINE_2           (1<< SPP_SEL_TO_SHIFT)
#define KBD_SEL_TO_LINE_3           (2<< SPP_SEL_TO_SHIFT)
#define KBD_SEL_TO_LINE_4           (3<< SPP_SEL_TO_SHIFT)
#define KBD_SEL_TO_LINE_5           (4<< SPP_SEL_TO_SHIFT)
#define KBD_SEL_TO_LINE_6           (5<< SPP_SEL_TO_SHIFT)
#define KBD_SEL_TO_LINE_7           (6<< SPP_SEL_TO_SHIFT)
#define KBD_SEL_TO_LINE_8           (7<< SPP_SEL_TO_SHIFT)

#define SPP_PASS_MIN_SHIFT  (9)
#define KBD_PASS_MIN_1   (1<<SPP_PASS_MIN_SHIFT)
#define KBD_PASS_MIN_2   (2<<SPP_PASS_MIN_SHIFT)
#define KBD_PASS_MIN_3   (3<<SPP_PASS_MIN_SHIFT)
#define KBD_PASS_MIN_4   (4<<SPP_PASS_MIN_SHIFT)
#define KBD_PASS_MIN_5   (5<<SPP_PASS_MIN_SHIFT)
#define KBD_PASS_MIN_6   (6<<SPP_PASS_MIN_SHIFT)
#define KBD_PASS_MIN_7   (7<<SPP_PASS_MIN_SHIFT)
#define KBD_PASS_MIN_8   (8<<SPP_PASS_MIN_SHIFT)


#define KBD_PASS_PROMPT_COLON           0x00000000
#define KBD_PASS_PROMPT_QUESTIONMARK    0x00010000

#define KBD_PIN_ALLOW_ENTER_ONLY        0x00010000
#define KBD_TIMEOUT_CENTI_SECONDS       0x80000000

#define PACKET_OFF	13
#define TRACE_DEVICE_NAME  0	//0-COM5(USB) 1-COM0 2-COM2

//extern uint8 flAmtOnly;
/*+++******* EXPORTED PROTOTYPES *******************************************---*/
/*secure*/
void _trace(const char * format,...);
//void _trace2(const char * format,...);
uint8 pp_open_hmi(void);
void pp_close_hmi(void);
void pp_settittle(char* tittle);
void pp_auto_update(uint8 bState);
void pp_display_update(void);
void pp_display_adjust(uint8 bState);
//void pp_kbd_flush(uint8 bState);
void pp_beep(uint32 count);
//void pp_sound(uint32 count,uint32 duration, uint32 frequency);
void pp_light_on(int m_on);
//void pp_light_off(void);
//void pp_light_adjust(uint8 contrast, uint8 backlight);
uint8 pp_prompt_table_set(char const* name);
#if 0
char* pp_prompt_get(promptIndex_t index, char* prompt, uint32 options);
#else
void pp_display_clear(uint32 line);
uint8 pp_display_text(uint32 line, uint32 col, char * prompt, promptAttrib_t attrib);
#endif
#if 0
uint8 pp_display_prompts(prompt_t const* prompts);
uint8 pp_amount_entry(prompt_t const* prompts, amount_t* amt, char const* sign, uint16 currency, uint32 options, uint8 timeout);
uint8 pp_amount_display(prompt_t const* prompts, amount_t amt, char const* sign, uint16 currency, uint32 options, uint8 timeout);
uint8 pp_pin_entry(uint8 min, uint8 max, uint32 options, uint8 timeout);
uint8 pp_password_entry(uint8 password_type, uint8 line, char* password, uint32 options, uint8 timeout);
uint8 pp_keyboard_entry(prompt_t const* prompts, char* buf, uint8 min, uint8 max, uint32 options, uint8 timeout);
uint8 pp_account_select(prompt_t const* prompts, uint32 acceptable, uint8 timeout);
uint8 pp_confirm(prompt_t const* prompts, uint8 timeout);
uint8 pp_datetime_entry(prompt_t const* prompts, uint32* date, uint32* time, uint32 options, uint8 timeout);
uint8 pp_ipaddress_entry(prompt_t const* prompts, uint8* ipaddress, uint32 options, uint8 timeout);
//void pp_display_dallas_version_no(void);
uint8 pp_key_map(uint8 system_key);

void pp_display(uint8 top, uint8 bottom);
uint8 pp_display_amount(char const* prompt, uint32 amt);

uint8 pp_get_password(uint8 prompt_type, uint8* pword);
uint8 pp_get_account(uint8* acct_type, uint8 line1, uint8 line2);

uint8 pp_get_pin(uint8 const* line1, uint8* pin, uint8 min, uint8 max, uint8 flags);
uint8 pp_get_yes_no(uint8 top, uint8 bottom, uint8 seconds, uint8 timeout_return);
uint8 pp_get_amount(uint8 top, uint32* amt, uint8 length);
uint8 pp_get_curr(uint8 top, uint32* amt, uint8 length, char const* sign, uint8 flags);
uint8 pp_getkbd(uint8 line1, uint8* buf, uint8 min, uint8 max, uint8 flags);

uint8 pp_set_font(size_t fontNumber);
/*multipy by BMP_FIXED_number to set scale*/
uint8 pp_set_scale(uint32 width,uint32 height);

uint8 pp_select(prompt_t const* pDisplay, prompt_t* pSelections, uint8 * iSelected, kbdCursor_t cursor,uint32 options,uint8 timeout);

//int16 pp_emv_verify_pin(psyPid_t pid);

void pp_set_keymat(char const* pSrc);

typedef enum
{
   PP_BEEP_TYPE_DEFAULT,
   PP_BEEP_TYPE_ERROR
} pp_beep_type_t;

void pp_set_beep
(
 /** type of beep to use*/
 pp_beep_type_t beeptype,
 uint32 beepcount,
 uint32 duration,
 uint32 frequency,
 uint32 volume
);


/*----------------------------------------------------------------------------*/
/** Set the language
@param pLanguage Pointer to a null terminated string containing the language 
setting
@retval TRUE if successful
@retval FALSE if successful
*/
uint8 pp_set_language(char const* pLanguage);


/*medium security*/

uint8 pp_password_entry_prompts(prompt_t const* prompts, char* password, uint32 options, uint8 timeout);

/*not secure (do not use these if possible)*/
uint8 pp_display_graphic(uint32 x, uint32 y, uint32 width, uint32 height, void const* graphic);
uint8 pp_amount_entry_text(char const* prefix, amount_t* amt, char const* sign,uint16 currency, uint32 options, uint8 timeout);
uint8 pp_keyboard_entry_free(char* buf, uint8 min, uint8 max, uint32 options, uint8 timeout);
uint8 pp_get_key(uint32 timeout);
uint8 pp_get_acceptable_key(uint32 acceptable, uint32 timeout);
uint8 pp_confirm_free(uint8 timeout);
void pp_free_display1(char const* prompt);
void pp_free_display2(char const* prompt);
uchar pp_display_curr(char const* prompt, uint32 amt, char const* sign, uint8 flags);


uint8 pp_key_detect(uint32 acceptable);
void pp_cancel(void);
uint8 pp_get_result(void);
void pp_install_font(size_t iFont, void const* pSrc);
void pp_reboot(void);

//aan
//void pp_force_open_printer(void);
//void pp_force_close_printer(void);
FILE * GetPrinterHandle(void);

#endif
//aan
extern char kbdRead(void);
int Service_HMI_call(int nSize, ST_hmi *hmi);
void pp_hex_dump(char *txt, void * buffer, uint16 len);
byte pp_KeyboardGetStatus(void);
char pp_getchar(void);
unsigned int pp_ttestall(unsigned int events,unsigned int TimeOut);
void xx_linefeed(uint8 lines);
void pp_print(char *txt, int wait, int attrib);
void pp_pprintf(char *fmt, ...);
void SetFrame(uint8 Status);
void pp_set_frame(uint8 bVisible);
void pp_display_text4(char *tittle, 
	char * prompt1, promptAttrib_t attrib1,
	char * prompt2, promptAttrib_t attrib2,
	char * prompt3, promptAttrib_t attrib3,
	char * prompt4, promptAttrib_t attrib4);
uint8 pp_get_key(uint32 timeout);
uint8 pp_get_hardware_type(void);
void getTerminalType(void);
void _trace4(const char * format,...);
void _trace_DSP2( char *txt, void * buffer, uint16 len);
void _trace5(const char * format,...);
#endif 



